package dhome.watcher;

import java.util.*;

public abstract class AbstractWatcher implements IWatcher{
	protected Map<String,IWatcherProcessor> it=new HashMap<String,IWatcherProcessor>();

	public void register_processor(String name, IWatcherProcessor p){
		it.put(name, p);
	}
	
	public void remove_processor(String name){
		it.remove(name);
	}
	
	public void replace_processor(String name, IWatcherProcessor p){
		it.put(name, p);
	}	
	
	public void fire_event(WatcherEvent evt, Object ... objects){
		for(IWatcherProcessor pp:it.values()){
			pp.processor(evt, objects);
		}
	}	
}
